package models

import (
	"time"
	"github.com/astaxie/beego/orm"
)

type Comment struct {
	Id          int64
	UserId      int     `orm:"column(userId)" ht:"list;name(用户Id)"`
	Username    string    `orm:"column(username);size(100);null" ht:"list;search;name(用户名)"`
	Type        int       `orm:"column(type)" ht:"name(评论类型);subclass([{\"Num\":0,\"Name\":\"活动咨询\"},{\"Num\":1,\"Name\":\"作品选登\"},{\"Num\":2,\"Name\":\"天使风采\"},{\"Num\":3,\"Name\":\"读书会简介\"},{\"Num\":4,\"Name\":\"读书会活动\"},{\"Num\":5,\"Name\":\"书香讲堂\"},{\"Num\":6,\"Name\":\"天下书坊\"},{\"Num\":7,\"Name\":\"家生活\"},{\"Num\":8,\"Name\":\"书坊创意设计\"},{\"Num\":9,\"Name\":\"文化用品\"},{\"Num\":10,\"Name\":\"图书\"}])"`
	TargetId    int64       `orm:"column(targetId)" ht:"list;search;name(被评文章Id)"`
	CommentTime time.Time `orm:"column(commentTime);type(date)" ht:"list;name(评论时间)"`
	Content     string    `orm:"column(content);size(300)" ht:"list;name(评论内容)"`
	StarCount   int       `orm:"column(loveusers)" ht:"list;name(评论点赞数)"`
}

//type
//0 活动咨询
//1 作品选登
//2 天使风采
//3 读书会简介
//4 读书会活动
//5 书香讲堂
//6 天下书坊
//7 家生活
//8 书坊创意设计
//9 文化用品
//10 图书
func init() {
	orm.RegisterModel(new(Comment))
}
func (*Comment)TableName() string {
	return "comment"
}

func (*Comment) FN_Id() string {
	return "Id"
}
func (*Comment) FN_UserId() string {
	return "UserId"
}
func (*Comment) FN_Username() string {
	return "Username"
}
func (*Comment) FN_Type() string {
	return "Type"
}
func (*Comment) FN_TargetId() string {
	return "TargetId"
}
func (*Comment) FN_CommentTime() string {
	return "CommentTime"
}
func (*Comment) FN_Content() string {
	return "Content"
}
func (*Comment) FN_StarCount() string {
	return "StarCount"
}